package cn.rongdao.jrkabao.ui.main.mainfragment.uicomponent;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.mifengkong.frtools.util.FRImageLoad;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.main.vip.MemberBean;


/**
 * Created by jack on 2018/1/25
 */

public class ItemMemberPowerUIComponent extends FrameLayout {
    public ItemMemberPowerUIComponent(Context context) {
        super(context);
    }

    public ItemMemberPowerUIComponent(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public ItemMemberPowerUIComponent(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private ImageView ivAvatar;
    private TextView tvContent;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        ivAvatar = findViewById(R.id.imp_iv_avatar);
        tvContent = findViewById(R.id.imp_tv_content);
    }

    public void setContent(MemberBean.VipPrivilegeBean data) {
        FRImageLoad.loadImage(data.getImg(), ivAvatar);
        tvContent.setText(FRString.valueOf(data.getDesc()));
    }
}
